//# include "ModifiedCSRmatrix.H"

# include "MCSRmatrix.H"


using namespace std ;
using namespace mg::numeric::algebra ;

int main() {

   MCSRmatrix<int> m01 =  {{0,1,0,0},{0,3,0,9},{2,0,0,3},{3,0,0,1}};
   MCSRmatrix<int> m02 =  {{1,1,0,14},{0,22,0,3},{0,0,33,34},{0,0,1,44}};

   MCSRmatrix<int> m03 = m01+m02 ;   


    MCSRmatrix<double> m3  = {{1.01, 0 , 0,0}, {0, 4.07, 0,0},{0,0,6.08,0},{1.06,0,2.2,9.9} };  //{0, 0, 0,  3.09}, {1.0, 2.4, 0,0}} ; 
  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<double> m4  = {{ 1.21, 0 , 1.06,0 }, {0, 3.31, 1.06,0},{0,1.06,-6.01,0},{4.12,0,1.06,-8.3}};//    
      

  cout << "---------------------------------------------------------------------------------------" << endl; 

   cout << m03 << endl;
   cout << endl;
   m03.printMCSR();   
  cout << "---------------------------------------------------------------------------------------" << endl; 
  cout << m3 ;
  cout << "---------------------------------------------------------------------------------------" << endl; 
  cout << m4 ;
  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<double> m5 = m3+m4 ;  
  cout << m5 ;
  
   MCSRmatrix<double> m6  = {{1.01, 2.34 , 43.1,0}, {0, 4.07, 0,0},{0,0,6.08,0},{1.06,0,2.2,9.9} };  //{0, 0, 0,  3.09}, {1.0, 2.4, 0,0}} ; 
  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<double> m7  = {{ 1.21, 1.03 , 0,2.15 }, {0, 3.31, 1.03,0},{0,1.06,-6.01,1.01},{4.12,1.1,1.06,-8.3}};
  cout << "---------------------------------------------------------------------------------------" << endl; 
  //MCSRmatrix<double> m8 = m6+m7 ;
  cout << m6 ;
  m6.printMCSR();
  cout << "---------------------------------------------------------------------------------------" << endl; 
  m7.printMCSR();
  cout << m7 ;
  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<double> m8 = m6+m7;
  cout << m8;   
  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<double> m100  = {{1.01, 0 , 2.34,0}, {0, 4.07, 0,0},{3.12,0,6.08,0},{1.06,0,2.2,9.9} };
  std::vector<double> v1={0,1.3,4.2,0.8};
  
  std::vector<double> v2 = m100*v1 ;
  cout << "---------------------------------------------------------------------------------------" << endl; 
  
  for(auto& x : v2)
    cout << x << ' ' ;
  cout << endl;
  
  MCSRmatrix<int> m9 = {{11,12,13,14,0,0},{0,22,23,0,333,0},{0,0,33,34,35,36},{0,0,0,44,45,0},
                           {0,3,0,445,0,56},{0,22,0,0,3,66}};

  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<int> m10= {{11,12,13,14,0,0},{0,22,23,0,0,0},{0,0,33,34,35,36},{0,0,0,44,45,0},
                           {0,1,0,45,0,56},{0,0,2,0,2,66}};
  
  MCSRmatrix<int> m11 = m9+m10;
  cout << "---------------------------------------------------------------------------------------" << endl; 
  cout << m11 ;
  m11.printMCSR();

  MCSRmatrix<int> m12("input17.dat");
  std::vector<int> v3 =   {3,4,0,1,6,8,1,19};
  
 // std::cout << m12 ;
  m12.print(); 
  std::vector<int> v4 =  m12*v3 ;
  
  for (auto & x : v4 )
      cout << x << ' ' ;
  cout <<endl;   
  MCSRmatrix<double> m14("input23.dat");
  cout << m14;
  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<double> m13("coo_matrix.mtx");
  cout << m13 ;    
  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<double> m15("mat002.mtx");                
  cout << m15 ;
  cout << "---------------------------------------------------------------------------------------" << endl; 
  MCSRmatrix<double> m16("mat003.mtx");                
  cout << m16 ;
  MCSRmatrix<double> m17("mat004.mtx");                
  cout << m17 ;
   return 0;
}




